import request from '@/utils/request'
// /discussion/list
export function getDiscussionList() {
  return request({
    url: '/discussion/list',
    method: 'get',
    params: {
      pageNum: 1,
      pageSize: 10,
    },
  });
}
// /discussion-likes/create
export function creatlikes(data) {
  return request({
    url: '/discussion-likes/create',
    method: 'post',
    data
  });
}
// /discussion/1
export function getDiscussion(id) {
  return request({
    url: `/discussion/${id}`,
    method: 'get',
  });
}

// /discussion-comments/create

export function creatcomments(data) {
  return request({
    url: '/discussion-comments/create',
    method: 'post',
    data
  });
}
// 
export function creatediscussion(data) {
  return request({
    url: '/discussion/create',
    method: 'post',
    data
  });
}

 // 若依文件上传
// /common/upload
export function upload(data) {
  const formData = new FormData();
  formData.append('file', data);
  return request({
    url: '/common/upload',
    method: 'post',
    data: formData
  });
}
 
// /system/dict/data/list?pageNum=1&pageSize=10&dictType=jb
export function getDictDataList() {
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params: {
      pageNum: 1,
      pageSize: 1000,
      dictType: 'jb'
    }
  });
}




// /discussion/delete/{{id}}
export function deleteDiscussion(id) {
  return request({
    url: `/discussion/delete/${id}`,
  });
}

